
export type RuleLevel = "off" | "warn" | "error";

export interface FilesConfig {
    maxSize?: number;
    ignore?: string[];
}

export interface AccessibilityRulesConfig {
    recommended?: boolean;
    all?: boolean;
    noAccessKey?: RuleLevel;
    noAutofocus?: RuleLevel;
    noBlankTarget?: RuleLevel;
    noDistractingElements?: RuleLevel;
    noHeaderScope?: RuleLevel;
    noPositiveTabindex?: RuleLevel;
    useAltText?: RuleLevel;
    useAnchorContent?: RuleLevel;
    useButtonType?: RuleLevel;
    useHtmlLang?: RuleLevel;
    useKeyWithClickEvents?: RuleLevel;
    useKeyWithMouseEvents?: RuleLevel;
    useValidAnchor?: RuleLevel;
}

export interface ComplexityRulesConfig {
    recommended?: boolean;
    all?: boolean;
    noExtraBooleanCast?: RuleLevel;
    noMultipleSpacesInRegularExpressionLiterals?: RuleLevel;
    noUselessFragments?: RuleLevel;
    useFlatMap?: RuleLevel;
    useOptionalChain?: RuleLevel;
    useSimplifiedLogicExpression?: RuleLevel;
}

export interface CorrectnessRulesConfig {
    recommended?: boolean;
    all?: boolean;
    noChildrenProp?: RuleLevel;
    noConstAssign?: RuleLevel;
    noConstructorReturn?: RuleLevel;
    noEmptyPattern?: RuleLevel;
    noNewSymbol?: RuleLevel;
    noPrecisionLoss?: RuleLevel;
    noRenderReturnValue?: RuleLevel;
    noSetterReturn?: RuleLevel;
    noStringCaseMismatch?: RuleLevel;
    noUndeclaredVariables?: RuleLevel;
    noUnnecessaryContinue?: RuleLevel;
    noUnreachable?: RuleLevel;
    noUnsafeFinally?: RuleLevel;
    noUnusedVariables?: RuleLevel;
    noVoidElementsWithChildren?: RuleLevel;
    noVoidTypeReturn?: RuleLevel;
    useValidForDirection?: RuleLevel;
}

export interface PerformanceRulesConfig {
    recommended?: boolean;
    all?: boolean;
    noDelete?: RuleLevel;
}

export interface SecurityRulesConfig {
    recommended?: boolean;
    all?: boolean;
    noDangerouslySetInnerHtml?: RuleLevel;
    noDangerouslySetInnerHtmlWithChildren?: RuleLevel;
}

export interface StyleRulesConfig {
    recommended?: boolean;
    all?: boolean;
    noArguments?: RuleLevel;
    noImplicitBoolean?: RuleLevel;
    noNegationElse?: RuleLevel;
    noNonNullAssertion?: RuleLevel;
    noShoutyConstants?: RuleLevel;
    noUnusedTemplateLiteral?: RuleLevel;
    noVar?: RuleLevel;
    useBlockStatements?: RuleLevel;
    useConst?: RuleLevel;
    useDefaultParameterLast?: RuleLevel;
    useEnumInitializers?: RuleLevel;
    useExponentiationOperator?: RuleLevel;
    useFragmentSyntax?: RuleLevel;
    useNumericLiterals?: RuleLevel;
    useSelfClosingElements?: RuleLevel;
    useShorthandArrayType?: RuleLevel;
    useSingleCaseStatement?: RuleLevel;
    useSingleVarDeclarator?: RuleLevel;
    useTemplate?: RuleLevel;
    useWhile?: RuleLevel;
}

export interface SuspiciousRulesConfig {
    recommended?: boolean;
    all?: boolean;
    noArrayIndexKey?: RuleLevel;
    noAsyncPromiseExecutor?: RuleLevel;
    noCatchAssign?: RuleLevel;
    noCommentText?: RuleLevel;
    noCompareNegZero?: RuleLevel;
    noConstEnum?: RuleLevel;
    noDebugger?: RuleLevel;
    noDoubleEquals?: RuleLevel;
    noDuplicateObjectKeys?: RuleLevel;
    noDuplicateParameters?: RuleLevel;
    noEmptyInterface?: RuleLevel;
    noExplicitAny?: RuleLevel;
    noExtraNonNullAssertion?: RuleLevel;
    noFunctionAssign?: RuleLevel;
    noImportAssign?: RuleLevel;
    noLabelVar?: RuleLevel;
    noRedundantUseStrict?: RuleLevel;
    noShadowRestrictedNames?: RuleLevel;
    noSparseArray?: RuleLevel;
    noUnsafeNegation?: RuleLevel;
    useDefaultSwitchClauseLast?: RuleLevel;
    useValidTypeof?: RuleLevel;
}

export interface NurseryRulesConfig {
    recommended?: boolean;
    all?: boolean;
    noAriaUnsupportedElements?: RuleLevel;
    noAssignInExpressions?: RuleLevel;
    noBannedTypes?: RuleLevel;
    noClassAssign?: RuleLevel;
    noCommaOperator?: RuleLevel;
    noConfusingArrow?: RuleLevel;
    noConfusingLabels?: RuleLevel;
    noConsoleLog?: RuleLevel;
    noDuplicateCase?: RuleLevel;
    noDuplicateClassMembers?: RuleLevel;
    noDuplicateJsxProps?: RuleLevel;
    noExtraLabels?: RuleLevel;
    noExtraSemicolons?: RuleLevel;
    noForEach?: RuleLevel;
    noGlobalObjectCalls?: RuleLevel;
    noInferrableTypes?: RuleLevel;
    noInnerDeclarations?: RuleLevel;
    noInvalidConstructorSuper?: RuleLevel;
    noNamespace?: RuleLevel;
    noNoninteractiveElementToInteractiveRole?: RuleLevel;
    noNoninteractiveTabindex?: RuleLevel;
    noParameterAssign?: RuleLevel;
    noParameterProperties?: RuleLevel;
    noPrototypeBuiltins?: RuleLevel;
    noRedeclare?: RuleLevel;
    noRedundantAlt?: RuleLevel;
    noRedundantRoles?: RuleLevel;
    noRestrictedGlobals?: RuleLevel;
    noSelfAssign?: RuleLevel;
    noSelfCompare?: RuleLevel;
    noSvgWithoutTitle?: RuleLevel;
    noSwitchDeclarations?: RuleLevel;
    noUnreachableSuper?: RuleLevel;
    noUnsafeOptionalChaining?: RuleLevel;
    noUnusedLabels?: RuleLevel;
    noUselessCatch?: RuleLevel;
    noUselessRename?: RuleLevel;
    noUselessSwitchCase?: RuleLevel;
    noWith?: RuleLevel;
    useAriaPropTypes?: RuleLevel;
    useAriaPropsForRole?: RuleLevel;
    useCamelCase?: RuleLevel;
    useExhaustiveDependencies?: RuleLevel;
    useHookAtTopLevel?: RuleLevel;
    useIframeTitle?: RuleLevel;
    useIsNan?: RuleLevel;
    useLiteralKeys?: RuleLevel;
    useMediaCaption?: RuleLevel;
    useNamespaceKeyword?: RuleLevel;
    useValidAriaProps?: RuleLevel;
    useValidLang?: RuleLevel;
    useYield?: RuleLevel;
}

export interface LinterRulesConfig {
    recommended?: boolean;
    all?: boolean;
    accessibility?: AccessibilityRulesConfig;
    complexity?: ComplexityRulesConfig;
    correctness?: CorrectnessRulesConfig;
    performance?: PerformanceRulesConfig;
    security?: SecurityRulesConfig;
    style?: StyleRulesConfig;
    suspicious?: SuspiciousRulesConfig;
    nursery?: NurseryRulesConfig;
};

export interface LinterConfig {
    enabled?: boolean;
    ignore?: string[];
    rules?: LinterRulesConfig;
}

export interface FormatterConfig {
    enabled?: boolean;
    ignore?: string[];
    formatWithErrors?: boolean;
    indentStyle?: "tab" | "space";
    indentSize?: number;
    lineWidth?: number;
}

export interface OrganizeImportsConfig {
    enabled?: boolean;
    ignore?: string[];
}

export interface JavascriptFormatterConfig {
    quoteStyle?: "single" | "double";
    quoteProperties?: "asNeeded" | "preserve";
    trailingComma?: "all" | "es5" | "none";
    semicolons?: "always" | "asNeeded";
}

export interface JavascriptConfig {
    formatter?: JavascriptFormatterConfig;
    globals?: string[];
}

export interface RomeConfig {
    files?: FilesConfig;
    linter?: LinterConfig;
    formatter?: FormatterConfig;
    organizeImports?: OrganizeImportsConfig;
    javascript?: JavascriptConfig;
}